Integrand size = 19, antiderivative size = 49 \[ \int \sin ^2(c+d x) (a+b \tan (c+d x)) \, dx=\frac {a x}{2}-\frac {b \log (\cos (c+d x))}{d}-\frac {\cos (c+d x) \sin (c+d x) (a+b \tan (c+d x))}{2 d} \]
Time = 0.05 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.14 \[ \int \sin ^2(c+d x) (a+b \tan (c+d x)) \, dx=\frac {a (c+d x)}{2 d}-\frac {b \left (-\frac {1}{2} \cos ^2(c+d x)+\log (\cos (c+d x))\right )}{d}-\frac {a \sin (2 (c+d x))}{4 d} \]
(a*(c + d*x))/(2*d) - (b*(-1/2*Cos[c + d*x]^2 + Log[Cos[c + d*x]]))/d - (a *Sin[2*(c + d*x)])/(4*d)
Time = 0.27 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.20, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {3042, 4889, 530, 25, 452, 216, 240}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sin ^2(c+d x) (a+b \tan (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sin (c+d x)^2 (a+b \tan (c+d x))dx\) |
\(\Big \downarrow \) 4889 |
\(\displaystyle \frac {\int \frac {\tan ^2(c+d x) (a+b \tan (c+d x))}{\left (\tan ^2(c+d x)+1\right )^2}d\tan (c+d x)}{d}\) |
\(\Big \downarrow \) 530 |
\(\displaystyle \frac {\frac {b-a \tan (c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}-\frac {1}{2} \int -\frac {a+2 b \tan (c+d x)}{\tan ^2(c+d x)+1}d\tan (c+d x)}{d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\frac {1}{2} \int \frac {a+2 b \tan (c+d x)}{\tan ^2(c+d x)+1}d\tan (c+d x)+\frac {b-a \tan (c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}}{d}\) |
\(\Big \downarrow \) 452 |
\(\displaystyle \frac {\frac {1}{2} \left (a \int \frac {1}{\tan ^2(c+d x)+1}d\tan (c+d x)+2 b \int \frac {\tan (c+d x)}{\tan ^2(c+d x)+1}d\tan (c+d x)\right )+\frac {b-a \tan (c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}}{d}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \frac {\frac {1}{2} \left (2 b \int \frac {\tan (c+d x)}{\tan ^2(c+d x)+1}d\tan (c+d x)+a \arctan (\tan (c+d x))\right )+\frac {b-a \tan (c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}}{d}\) |
\(\Big \downarrow \) 240 |
\(\displaystyle \frac {\frac {1}{2} \left (a \arctan (\tan (c+d x))+b \log \left (\tan ^2(c+d x)+1\right )\right )+\frac {b-a \tan (c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}}{d}\) |
((a*ArcTan[Tan[c + d*x]] + b*Log[1 + Tan[c + d*x]^2])/2 + (b - a*Tan[c + d *x])/(2*(1 + Tan[c + d*x]^2)))/d
3.1.14.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
Int[(x_)/((a_) + (b_.)*(x_)^2), x_Symbol] :> Simp[Log[RemoveContent[a + b*x ^2, x]]/(2*b), x] /; FreeQ[{a, b}, x]
Int[((c_) + (d_.)*(x_))/((a_) + (b_.)*(x_)^2), x_Symbol] :> Simp[c Int[1/ (a + b*x^2), x], x] + Simp[d Int[x/(a + b*x^2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c^2 + a*d^2, 0]
Int[(x_)^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symb ol] :> With[{Qx = PolynomialQuotient[x^m*(c + d*x)^n, a + b*x^2, x], e = Co eff[PolynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 0], f = Coeff[Po lynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 1]}, Simp[(a*f - b*e*x )*((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] + Simp[1/(2*a*(p + 1)) Int[(a + b*x^2)^(p + 1)*ExpandToSum[2*a*(p + 1)*Qx + e*(2*p + 3), x], x], x]] /; FreeQ[{a, b, c, d}, x] && IGtQ[n, 0] && IGtQ[m, 0] && LtQ[p, -1] && EqQ[n, 1] && IntegerQ[2*p]
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, With[{d = FreeFactors [Tan[v], x]}, Simp[d/Coefficient[v, x, 1] Subst[Int[SubstFor[1/(1 + d^2*x ^2), Tan[v]/d, u, x], x], x, Tan[v]/d], x]] /; !FalseQ[v] && FunctionOfQ[N onfreeFactors[Tan[v], x], u, x]] /; InverseFunctionFreeQ[u, x] && !MatchQ[ u, (v_.)*((c_.)*tan[w_]^(n_.)*tan[z_]^(n_.))^(p_.) /; FreeQ[{c, p}, x] && I ntegerQ[n] && LinearQ[w, x] && EqQ[z, 2*w]]
Time = 0.59 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.06
method | result | size |
derivativedivides | \(\frac {a \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+b \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(52\) |
default | \(\frac {a \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+b \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(52\) |
risch | \(i b x +\frac {a x}{2}+\frac {{\mathrm e}^{2 i \left (d x +c \right )} b}{8 d}+\frac {i {\mathrm e}^{2 i \left (d x +c \right )} a}{8 d}+\frac {{\mathrm e}^{-2 i \left (d x +c \right )} b}{8 d}-\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} a}{8 d}+\frac {2 i b c}{d}-\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(99\) |
Time = 0.27 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.96 \[ \int \sin ^2(c+d x) (a+b \tan (c+d x)) \, dx=\frac {a d x + b \cos \left (d x + c\right )^{2} - a \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, b \log \left (-\cos \left (d x + c\right )\right )}{2 \, d} \]
\[ \int \sin ^2(c+d x) (a+b \tan (c+d x)) \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right ) \sin ^{2}{\left (c + d x \right )}\, dx \]
Time = 0.29 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.06 \[ \int \sin ^2(c+d x) (a+b \tan (c+d x)) \, dx=\frac {{\left (d x + c\right )} a + b \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - \frac {a \tan \left (d x + c\right ) - b}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \]
Leaf count of result is larger than twice the leaf count of optimal. 373 vs. \(2 (45) = 90\).
Time = 0.38 (sec) , antiderivative size = 373, normalized size of antiderivative = 7.61 \[ \int \sin ^2(c+d x) (a+b \tan (c+d x)) \, dx=\frac {2 \, a d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 2 \, a d x \tan \left (d x\right )^{2} + 2 \, a d x \tan \left (c\right )^{2} + b \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{2} + 2 \, a \tan \left (d x\right )^{2} \tan \left (c\right ) - 2 \, b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) \tan \left (c\right )^{2} + 2 \, a \tan \left (d x\right ) \tan \left (c\right )^{2} + 2 \, a d x - b \tan \left (d x\right )^{2} - 4 \, b \tan \left (d x\right ) \tan \left (c\right ) - b \tan \left (c\right )^{2} - 2 \, b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) - 2 \, a \tan \left (d x\right ) - 2 \, a \tan \left (c\right ) + b}{4 \, {\left (d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + d \tan \left (d x\right )^{2} + d \tan \left (c\right )^{2} + d\right )}} \]
1/4*(2*a*d*x*tan(d*x)^2*tan(c)^2 - 2*b*log(4*(tan(d*x)^2*tan(c)^2 - 2*tan( d*x)*tan(c) + 1)/(tan(d*x)^2*tan(c)^2 + tan(d*x)^2 + tan(c)^2 + 1))*tan(d* x)^2*tan(c)^2 + 2*a*d*x*tan(d*x)^2 + 2*a*d*x*tan(c)^2 + b*tan(d*x)^2*tan(c )^2 - 2*b*log(4*(tan(d*x)^2*tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x)^2* tan(c)^2 + tan(d*x)^2 + tan(c)^2 + 1))*tan(d*x)^2 + 2*a*tan(d*x)^2*tan(c) - 2*b*log(4*(tan(d*x)^2*tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x)^2*tan( c)^2 + tan(d*x)^2 + tan(c)^2 + 1))*tan(c)^2 + 2*a*tan(d*x)*tan(c)^2 + 2*a* d*x - b*tan(d*x)^2 - 4*b*tan(d*x)*tan(c) - b*tan(c)^2 - 2*b*log(4*(tan(d*x )^2*tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x)^2*tan(c)^2 + tan(d*x)^2 + tan(c)^2 + 1)) - 2*a*tan(d*x) - 2*a*tan(c) + b)/(d*tan(d*x)^2*tan(c)^2 + d *tan(d*x)^2 + d*tan(c)^2 + d)
Time = 4.28 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.02 \[ \int \sin ^2(c+d x) (a+b \tan (c+d x)) \, dx=\frac {\frac {b\,{\cos \left (c+d\,x\right )}^2}{2}-\frac {a\,\sin \left (c+d\,x\right )\,\cos \left (c+d\,x\right )}{2}+\frac {b\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{2}+\frac {a\,d\,x}{2}}{d} \]